package com.zwh.shardingjdbc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * 项目启动类
 * 继承SpringBootServletInitializer类，让项目支持springboot项目打包成war包在tomcat下启动
 * springboot默认只能在tomcat7及以上才可以正常运行
 * exclude = {org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration.class}
 * @author zhangwenhe
 */
@SpringBootApplication
public class Application extends SpringBootServletInitializer{

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        this.setRegisterErrorPageFilter(false); // 错误页面有容器来处理，而不是SpringBoot
        return builder.sources(Application.class);
    }
}
